package zust.javaee.entity;

import javax.persistence.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by liy on 2016/12/18.
 */
@Entity
@Table(name = "tactivity")
public class Tactivity {

    private Integer id;
    private String name;
    private Tcorporation tcorporation;
    private Tmember principal;  //负责人
    private String principalTel;
    private String description;
    private Date signStartTime;
    private Date signEndTime;
    private Date beginTime;
    private Date endTime;
    private String place;
    private Short level;
    private Short status;


    private Set<TsignupActivityForm> tsignupActivityForms = new HashSet<TsignupActivityForm>(0);

    public Tactivity() {
    }

    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "corporation_id")
    public Tcorporation getTcorporation() {
        return tcorporation;
    }

    public void setTcorporation(Tcorporation tcorporation) {
        this.tcorporation = tcorporation;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "principal_id")
    public Tmember getPrincipal() {
        return principal;
    }

    public void setPrincipal(Tmember principal) {
        this.principal = principal;
    }

    @Column(name = "principal_tel")
    public String getPrincipalTel() {
        return principalTel;
    }

    public void setPrincipalTel(String principalTel) {
        this.principalTel = principalTel;
    }

    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "signup_start_time")
    public Date getSignStartTime() {
        return signStartTime;
    }

    public void setSignStartTime(Date signStartTime) {
        this.signStartTime = signStartTime;
    }

    @Column(name = "signup_end_time")
    public Date getSignEndTime() {
        return signEndTime;
    }

    public void setSignEndTime(Date signEndTime) {
        this.signEndTime = signEndTime;
    }

    @Column(name = "begin_time")
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    @Column(name = "end_time")
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Column(name = "place")
    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    @Column(name = "level")
    public Short getLevel() {
        return level;
    }

    public void setLevel(Short level) {
        this.level = level;
    }

    @Column(name = "status")
    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tactivity")
    public Set<TsignupActivityForm> getTsignupActivityForms() {
        return tsignupActivityForms;
    }

    public void setTsignupActivityForms(Set<TsignupActivityForm> tsignupActivityForms) {
        this.tsignupActivityForms = tsignupActivityForms;
    }
}
